<template>
  <el-button v-clipboard:copy="value" v-clipboard:success="clipboardSuccess" type="primary" icon="el-icon-document-copy" plain />
</template>

<script>
import clipboard from '@/directive/clipboard/index.js' // use clipboard by v-directive

export default {
  directives: { clipboard },
  props: {
    value: {
      type: String,
      default: ''
    }
  },
  created() {},
  methods: {
    clipboardSuccess() {
      this.$message({
        message: 'Copy successfully',
        type: 'success',
        duration: 1500
      })
    }
  }
}
</script>
